﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:cmd="clr-namespace:System.Windows.Input;assembly=PresentationCore"
        xmlns:local="clr-namespace:AEA.RSSFeedReader"
        x:Class="AEA.RSSFeedReader.AddFeedUc"
        x:Name="AddFeedControl"
        Height="Auto"
        Width="Auto"
        Background="{StaticResource Background}"
        ShowInTaskbar="False"
        WindowStyle="SingleBorderWindow"
        Activated="OnActivated"
        WindowStartupLocation="CenterOwner"
        SizeToContent="WidthAndHeight"
        ResizeMode="NoResize">

    <Window.CommandBindings>
        <cmd:CommandBinding Command="local:Commands.AddFeedCommand"
                            Executed="DoAddFeedCommand"
                            CanExecute="CanExecuteAddFeedCommand" />
        <cmd:CommandBinding Command="local:Commands.AutoAddFeedUriCommand"
                            Executed="DoAutoAddFeedUroCommand" />
        <cmd:CommandBinding Command="local:Commands.ExitCommand"
                            Executed="DoExitCommand" />
    </Window.CommandBindings>

    <Window.InputBindings>
        <cmd:KeyBinding Command="local:Commands.ExitCommand"
                        Key="Escape" />
    </Window.InputBindings>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"
                           MinHeight="41" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBox  x:Name="_inputText"
                  Text=""
                  TextWrapping="NoWrap"
                  Margin="5,5,5,0"
                  TextDecorations="None"
                  ToolTip="Type or paste the feed here."
                  Height="28"
                  VerticalAlignment="Top"
                  Width="300" />
        <Button HorizontalAlignment="Left"
                Content="Add"
                Grid.Row="1"
                x:Name="_addButton"
                Width="97"
                IsDefault="True"
                Margin="5,0,0,5"
                Height="31"
                VerticalAlignment="Bottom"
                Command="local:Commands.AddFeedCommand" />
        <Button Content="Cancel"
                Grid.Row="1"
                x:Name="_cancelButton"
                Margin="0,0,5,5"
                Height="31"
                HorizontalAlignment="Right"
                VerticalAlignment="Bottom"
                Width="97"
                VerticalContentAlignment="Center"
                Click="CancelClicked" />
    </Grid>
</Window>